package com.hdax.dm.controller;

import com.hdax.dm.dto.CommonResponse;
import com.hdax.dm.dto.item.FloorItemDto;
import com.hdax.dm.dto.item.HotItemDto;
import com.hdax.dm.service.IndexQiziService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(path = "/multiple")
public class IndexQiziController {

    @Autowired
    private IndexQiziService qiziService;

    //亲子轮播
    @RequestMapping(path = "/getCarouselData")
    public CommonResponse<List<HotItemDto>> getCarouselData(@RequestBody Map<String,Long> params){
        return qiziService.getCarouselData(params.get("itemTypeId"));
    }

    //精彩聚焦
    @RequestMapping(path = "/getWonderfulData")
    public CommonResponse<List<FloorItemDto>> getWonderfulData(@RequestBody Map<String,Long> params){
        return qiziService.getWonderfulData(params.get("itemTypeId"));
    }

    //根据年龄段查询节目
    @RequestMapping(path = "/getParentChild")
    public CommonResponse<FloorItemDto> getParentChild(@RequestBody Map<String,Long> params){
        return qiziService.getParentChild(params.get("ageGroup"));
    }

    //获取热门排行数据信息
    @RequestMapping(path = "/getPopularSearch")
    public CommonResponse<FloorItemDto> getPopularSearch(@RequestBody Map<String,Long> params){
        return qiziService.getPopularSearch(params.get("itemTypeId"));
    }

    //获取页面广告地址及信息页面
    @RequestMapping(path = "/getAdimgUrl")
    public CommonResponse<FloorItemDto> getAdimgUrl(@RequestBody Map<String,Long> params){
        return qiziService.getAdimgUrl(params.get("itemTypeId"));
    }

    //日历
    @RequestMapping(path = "/getCalendarData")
    public CommonResponse<List<Map<String,Object>>> getCalendarData(@RequestBody Map<String,Long> params){
        return qiziService.getCalendarData(params.get("itemTypeId"));
    }
}
